package com.chencong.online.function;

import com.chencong.online.bean.OrderEventBean;
import com.chencong.online.bean.ReceiptEventBean;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.streaming.api.functions.co.ProcessJoinFunction;
import org.apache.flink.util.Collector;

/**
 * @program: user-behavior-analysis-online
 * @ClassName PayReceiptProJoinFunc
 * @description:自定义函数
 * @author: chencong
 * @create: 2022-01-06 16:46
 **/
public class PayReceiptProJoinFunc extends ProcessJoinFunction<OrderEventBean, ReceiptEventBean, Tuple2<OrderEventBean, ReceiptEventBean>> {
    @Override
    public void processElement(OrderEventBean left, ReceiptEventBean right, ProcessJoinFunction<OrderEventBean, ReceiptEventBean, Tuple2<OrderEventBean, ReceiptEventBean>>.Context ctx, Collector<Tuple2<OrderEventBean, ReceiptEventBean>> out) throws Exception {
        out.collect(new Tuple2<>(left, right));
        System.out.println("左边是：" + left);
        System.out.println("右边是：" + right);
    }
}
